
//时钟
var cYear = document.getElementById("year");
var cMon = document.getElementById("mon");
var cDat = document.getElementById("dat");
var cHou = document.getElementById("hou");
var cMin = document.getElementById("min");
var cSec = document.getElementById("sec");

getTime();

setInterval(function(){
	getTime();
},1000);
//setInterval是在若干秒后开始执行

function getTime()
{
	var oDate = new Date();
	//调用Date函数
var aYear = oDate.getYear();
//getYear获取年份是1900年到现在的时间，1900年也可以叫做计算机时间的元年
var aYear2 = oDate.getFullYear();
//getFullYear()是获取当年年份，公元历
var aMonth = oDate.getMonth()+1;
//getMonth()获取月份，会获取到0-11，获取到当前的月份需要在原本的基础上+1
var aDay = oDate.getDay();
//getDay()获取到的是当前的星期数
var aDate = oDate.getDate();
//getDate是获取到当前的日期
var aHours = oDate.getHours();
var aMin = oDate.getMinutes();
var aSec = oDate.getSeconds();
if(aSec<10)
{
	aSec = "0"+aSec;
	}
	cYear.innerHTML=aYear2;
	cMon.innerHTML=aMonth;
	cDat.innerHTML=aDate;
	cHou.innerHTML=aHours;
	cMin.innerHTML=aMin;
	cSec.innerHTML=aSec;
}


window.onload=window.onresize=function(){
//	获取after宽度和高度
var oDiv1 = document.getElementsByClassName('leftMiddle')[0];
var oDiv1width=window.getComputedStyle(oDiv1,'::before').getPropertyValue('width');
var oDiv1height=window.getComputedStyle(oDiv1,'::before').getPropertyValue('height');

oDiv1width = oDiv1width.slice(0,-2);
oDiv1height = oDiv1height.slice(0,-2);



var oDiv1width1 = parseInt(oDiv1width)+1;
var oDiv1height1 = parseInt(oDiv1height)-1;
var oDiv1height2 = parseInt(oDiv1height)+1;
var oDiv1width2 = parseInt(oDiv1width)-1;
var keyCss=document.styleSheets[0];
//	等比宽
//第一个clip
	keyCss.cssRules[3][0].style.cssText="clip:rect(0px,"+oDiv1width+"px,2px,0px);";
//第二个clip	
	keyCss.cssRules[3][1].style.cssText="clip:rect(0px,2px,"+oDiv1height+"px,0px);";
//第三个clip	
	keyCss.cssRules[3][2].style.cssText="clip:rect("+oDiv1height1+"px,"+oDiv1width1+"px,"+oDiv1height2+"px,0px);";
//第四个clip	
	keyCss.cssRules[3][3].style.cssText="clip:rect(0px,"+oDiv1width1+"px,"+oDiv1height2+"px,"+oDiv1width2+"px);";
}

